package com.cbs.android.module.user.user.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by broche on 10/30/15.
 */
public class User implements Parcelable {
    private int id;
    private String username;
    private String nickname;
    private String realname;
    private int sex = -1;
    private String birthday;
    private String avatar;
    private String homeimage;
    private String token;
    private int roleid;
    private int islocked;
    private String extra_1;
    private String extra_2;
    private String extra_3;
    private String extra_4;
    private String extra_5;

    public User() {

    }

    public int getId() {
        return id;
    }

    public User setId(int id) {
        this.id = id;
        return this;
    }

    public String getUserName() {
        return username;
    }

    public User setUserName(String userName) {
        this.username = userName;
        return this;
    }

    public String getNickName() {
        return nickname;
    }

    public User setNickName(String nickName) {
        this.nickname = nickName;
        return this;
    }

    public String getRealName() {
        return realname;
    }

    public User setRealName(String realName) {
        this.realname = realName;
        return this;
    }

    public int getSex() {
        return sex;
    }

    public User setSex(int sex) {
        this.sex = sex;
        return this;
    }

    public String getBirthday() {
        return birthday;
    }

    public User setBirthday(String birthday) {
        this.birthday = birthday;
        return this;
    }

    public String getAvatar() {
        return avatar;
    }

    public User setAvatar(String avatar) {
        this.avatar = avatar;
        return this;
    }

    public String getHomeImage() {
        return homeimage;
    }

    public User setHomeImage(String homeImage) {
        this.homeimage = homeImage;
        return this;
    }

    public String getToken() {
        return token;
    }

    public User setToken(String token) {
        this.token = token;
        return this;
    }

    public int getRoleId() {
        return roleid;
    }

    public int isLocked() {
        return islocked;
    }

    public String getExtra_1() {
        return extra_1;
    }

    public User setExtra_1(String extra_1) {
        this.extra_1 = extra_1;
        return this;
    }

    public String getExtra_2() {
        return extra_2;
    }

    public User setExtra_2(String extra_2) {
        this.extra_2 = extra_2;
        return this;
    }

    public String getExtra_3() {
        return extra_3;
    }

    public User setExtra_3(String extra_3) {
        this.extra_3 = extra_3;
        return this;
    }

    public String getExtra_4() {
        return extra_4;
    }

    public User setExtra_4(String extra_4) {
        this.extra_4 = extra_4;
        return this;
    }

    public String getExtra_5() {
        return extra_5;
    }

    public User setExtra_5(String extra_5) {
        this.extra_5 = extra_5;
        return this;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(username);
        dest.writeString(nickname);
        dest.writeString(realname);
        dest.writeInt(sex);
        dest.writeString(birthday);
        dest.writeString(avatar);
        dest.writeString(homeimage);
        dest.writeString(token);
        dest.writeInt(roleid);
        dest.writeInt(islocked);
        dest.writeString(extra_1);
        dest.writeString(extra_2);
        dest.writeString(extra_3);
        dest.writeString(extra_4);
        dest.writeString(extra_5);
    }

    public static final Parcelable.Creator<User> CREATOR = new Creator<User>() {
        @Override
        public User createFromParcel(Parcel source) {
            return new User(source);
        }

        @Override
        public User[] newArray(int size) {
            return new User[size];
        }

    };

    private User(Parcel dest) {
        id = dest.readInt();
        username = dest.readString();
        nickname = dest.readString();
        realname = dest.readString();
        sex = dest.readInt();
        birthday = dest.readString();
        avatar = dest.readString();
        homeimage = dest.readString();
        token = dest.readString();
        roleid = dest.readInt();
        islocked = dest.readInt();
        extra_1 = dest.readString();
        extra_2 = dest.readString();
        extra_3 = dest.readString();
        extra_4 = dest.readString();
        extra_5 = dest.readString();
    }
}
